An electrical device having a pressure compensation element is described in German Patent Application No. DE 38 17 227, in which the pressure compensation element is inserted into an opening in a housing. A disadvantage of this design is that on the one hand the pressure compensation element is composed of numerous individual parts, and on the other hand an additional joining process is necessary for fastening the pressure compensation element in the housing.